package com.stack.admin.controller.v1;


import com.stack.admin.service.AdUserService;
import com.stack.model.admin.dtos.AdUserDto;
import com.stack.model.admin.dtos.PageQueryDto;
import com.stack.model.admin.pojos.AdUser;
import com.stack.model.common.dtos.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author llz
 * @date 2023/11/14 23:40
 * @description
 */
@Api(value= "用户审核")
@RestController
@RequestMapping("/api/v1/auth")
public class AdUserCheckController {

    /**
     * // 用户审核
     * export const API_AUTH_LIST = '/service_6001/admin/api/v1/auth/list'
     * export const API_AUTH_PASS = '/service_6001/admin/api/v1/auth/authPass'
     * export const API_AUTH_FAIL = '/service_6001/admin/api/v1/auth/authFail'
     */

    @Resource
    private AdUserService adUserService;

    @ApiOperation("获取用户列表")
    @PostMapping("/list")
    public ResponseResult getUserList(@RequestBody PageQueryDto dto) {
        return adUserService.getUserList(dto);
    }

    @ApiOperation("用户审核通过")
    @PostMapping("/authPass")
    public ResponseResult authPass(@RequestBody AdUserDto dto){
        return adUserService.authPass(dto);
    }

    @ApiOperation("用户审核失败")
    @PostMapping("/authFail")
    public ResponseResult authFail(@RequestBody AdUserDto dto){
        return adUserService.authFail(dto);
    }

}

